//
//  ApplicationConstruct.h
//  Tag-C
//
//  Created by KyuJin on 13. 2. 5..
//  Copyright (c) 2013년 monscape. All rights reserved.
//

#ifndef Tag_C_ApplicationConstruct_h
#define Tag_C_ApplicationConstruct_h

#define SAFE_RELEASE(x) if(x){[x release]; x = nil;}
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

#define ToRadian(degree)    ((degree) * (M_PI / 180.0f))
#define ToDegree(radian)    ((radian) * (180.0f / M_PI))

#define FULL_FRAME_SIZE_IPHONE4 CGRectMake(0, 0, 320, 460)
#define FULL_FRAME_SIZE_IPHONE5 CGRectMake(0, 0, 320, 548)

#ifdef DEBUG
#define DebugLog(fmt,...) NSLog(@"%@",[NSString stringWithFormat:(fmt), ##__VA_ARGS__]);
#else
// If debug mode hasn't been enabled, don't do anything when the macro is called
#define DebugLog(...)
#endif

// Log using the same parameters above but include the function name and source code line number in the log statement
#ifdef DEBUG
#define DebugLogDetailed(fmt, ...) NSLog((@"Func: %s, Line: %d, " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DebugLogDetailed(...)
#endif

// This macro will create a detailed log message and run even during a production build
#define DetailedLog(fmt, ...) NSLog((@"Func: %s, Line: %d, " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);

#define NetworkDisconnect @"NetworkDisconnect"
#define NetworkConnected @"NetworkConnect"

#define LAUNCH_TYPE_TAG 0
#define LAUNCH_TYPE_DIRECT 1

#endif
